<div id="content">
    <div class="container">
        <div id="main">
            <?php if( $posts ): foreach($posts as $post): ?>
                <div class="entry">
                    <div class="entry-header">
                        <h2><a href="<?php echo site_url('post/'.$post->entry_id);?>"><?php echo ucwords($post->entry_name);?></a></h2>
                        <p class="meta"><?php echo lang('escrito_por');?>&nbsp;
                            <a href="#"><?php echo ucfirst($post->usu_nombre);?></a>&nbsp;|&nbsp;<?php echo lang('etiquetas');?>:&nbsp;
                            <?php $item = $this->blog_model->get_related_categories($post->entry_id); 
                            foreach($item as $category): ?>
                                <a href="<?php echo base_url('category/'.$category->slug);?>">
                                    <?php echo $category->category_name;?>
                                </a>&nbsp;
                            <?php endforeach;?>
                        </p>
                        <a href="<?php echo site_url('post/'.$post->entry_id);?>" class="button"><?php echo lang('leer_mas');?>...</a>
                    </div><!-- end .entry-header -->
                    <div class="entry-content">
                        <?php echo $post->entry_body;?>

                        <p class="postmeta">		
                            <a href="<?php echo site_url('post/'.$post->entry_id);?>" class="readmore"><?php echo lang('leer_mas');?></a> |
                            <a href="<?php echo site_url('post/'.$post->entry_id.'#comments');?>" class="comments"><?php echo lang('comentarios');?> (<?php echo $post->comment_count;?>)</a> |				
                            <span class="date"><?php echo mdate('%n %M %Y %H:%i:%s',human_to_unix($post->entry_date));?></span>	| 
                            <a href="<?php echo site_url('delete_post/'.$post->entry_id);?>" class="readmore"><?php echo lang('borrar');?></a>
                        </p>
                    </div><!-- end .entry-content -->
                </div><!-- end .entry -->                        
            <?php endforeach; else: ?>
                <h2>No post yet!</h2>
            <?php endif;?>
            <?php echo $this->pagination->create_links();?>
        </div><!-- end #main -->
        <?php include 'menu_sidebar.php';?>
        <div class="clear"></div>
    </div><!-- end .container -->
</div><!-- end #content -->
